/**
 * 北京钉图互动科技 all right reserver
 */
package com.sincebest.fivestar.common.exception.translate;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Wangyi
 * @since 2016年6月24日
 */
@Configuration
public class ExceptionTranslatorConfiguration {

	@Bean
	public DefaultExceptionErrorCodeMapping defaultExceptionErrorCodeMapping() {
		DefaultExceptionErrorCodeMapping exceptionErrorCodeMapping = new DefaultExceptionErrorCodeMapping();
		return exceptionErrorCodeMapping;
	}

	@Bean
	public ErrorResponseTranslatable defaultErrorResponseTranslator(ExceptionErrorCodeSupplier errorCodeSupplier) {
		return new DefaultErrorResponseTranslator(errorCodeSupplier);
	}

}
